//
//  RouteDetailMapView.swift
//  Cycling
//
//  Created by CSS on 4/12/23.
//

import Foundation
import MapboxNavigation
import MapboxCoreNavigation
import MapboxDirections


class RouteDetailMapView: NSObject {
    
    @objc class func mapView(withRouteJson json: String?) -> NavigationMapView? {
        guard let json = json?.replacingOccurrences(of: "&quot;", with: "\""), json.count > 0 else {
            return nil
        }
        
        guard let jsonData: Data = json.data(using: .utf8) else {
            return nil
        }
        if let jsonArray = try? JSONSerialization.jsonObject(with: jsonData) {
            print("jsonArray: \(jsonArray)")
        }
        
//        guard let route = try? JSONDecoder().decode(NSDictionary.Type, from: jsonData) else {
//            return nil
//        }
        let mapView: NavigationMapView = .init(frame: .zero)
        
        return mapView
    }
    
}
